package com.jimmy.ioc.annotation;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @version 1.0
 * @ ClassName MyBeanFactory
 * <p> TODO
 * @ author JIMMY
 * @ Date 2020/10/24 0024 下午 9:25
 */
@Configuration  //相当于配置文件(可服务于XML扫描另外也可以用annotation读取不用基于XML扫描参考config文件模块)
public class MyBeanFactory {
    @Bean(name = "bookService")
    public BookService getInst(){
        return new BookService();
    }
    @Bean(name = "bookDao")
    public BookDao getInst2(){
        return new BookDao();
    }
}
